import {Pipe, PipeTransform} from "@angular/core";
/**
 * Created by Administrator on 2017/3/28.
 */
@Pipe({name: 'roleType'})
export class RoleTypePipe implements PipeTransform {
       transform(value: any): string {
        let result: string = "-";
        for(let type of this.types){
            if(type.value==value){
                return type.name;
            }
        }
        return "未知"
    }


    types: any = [
        {name: "超级管理员", value: "0"},
        {name: "审核员", value: "1"},
        {name: "普通用户", value: "2"},
    ]


    getTypes(): any {
        return this.types
    }
}